#include<bits/stdc++.h>
using namespace std;
int i,j,n;
string binary(int x)
{
	string res="";
	while(x)
	{
		res+=to_string(x%2);
		x/=2;
	}
	while(res.size()<31)res+='0';
	swap(res[i],res[j]);
	reverse(res.begin(),res.end());
	return res;
}

int s_to_int(string num)
{
	int ans=0,weight=1;
	//swap(num[i],num[j]);
	for(int i=num.size()-1;i>=0;i--)
	{
		
		ans+=(num[i]-'0')*weight;
		weight*=2;
	}
	return ans;
}
int main()
{
	cout<<binary(14);
	cin>>n>>i>>j;
	cout<<s_to_int(binary(n));
	return 0;
}
